1. Field of the Invention
The present invention relates to the storage and/or access of digital data. More particularly, the invention concerns a method, apparatus, and article of manufacture using a volume trailer to more efficiently store digital data on a direct access storage device (DASD) in emulation of sequential-access media. Another aspect of the invention concerns the access of data stored pursuant to the invention.
2. Description of the Related Art
Over the years, engineers have developed many different ways of digitally storing data. Two of the most popular involve sequential-access storage drives (i.e., tape media), and DASD. As an example, DASD storage includes magnetic hard disk drives and magnetic floppy diskettes. Tape storage, for instance, includes different electromagnetic or optical wound tapes, and may involve storage patterns such as linear, helical, and serpentine.
DASD and tape storage offer contrasting benefits and limitations. Thus, users may choose DASD for some storage needs, and tape for others. Along these lines, DASD and tape storage have each evolved through the years with contrasting storage formats. This is due to the different physical characteristics of the respective media. In particular, DASD-stored data is randomly accessible, by simply moving a read/write head directly to a specific sector and track location where a desired data item exists. In contrast, tape-stored data is accessed sequentially, by rewinding or advancing the tape until reaching the desired data item.
In tape storage, data is typically stored in units called xe2x80x9crecordsxe2x80x9d or xe2x80x9cblocksxe2x80x9d. Interspersed with the records are various headers, each of which contains information describing various characteristics of the associated data record. Adjacent header/record pairs are separated by an inter-block gap (IBG), which is a unique hardware-recognizable pattern of stored data. The IBGs are particularly advantageous when attempting to locate a particular data record on the tape. First, the tape is advanced to a point on the tape where the data record likely begins, or to a point where a group of records including the data record begins. Then, the tape head advances or rewinds, record-by-record, until the desired record is reached. Such movement of the tape head is conducted using the IBGs as guideposts.
In addition to individual record or xe2x80x9cblockxe2x80x9d headers, a tape usually includes a volume header near the beginning of tape (BOT) point. The volume header includes various statistics concerning all records contained on the tape. The volume header is necessarily placed at the tape""s beginning because, when a tape cartridge is first loaded to a tape drive, access of the tape begins at the BOT point. To locate the volume header elsewhere would require time consuming forwarding of the tape to reach the volume header.
The foregoing description of tape storage significantly contrasts with DASD storage. Although most formats of DASD storage use headers of various types, DASD storage does not require IBGs. This is because the DASD read/write head, by virtue of its inherent random access capability, can proceed directly to the desired data, without having to sequence record-by-record to find a desired record.
With the advent of virtual tape systems (VTSs), the line between DASD and tape storage has blurred. VTSs chiefly store data on tape, taking advantage of this inexpensive means of long term data storage. However, to expedite data exchanges, data is cached in DASD. According to a predetermined criteria, such as the data""s age or recency/frequency of use, the data is backed up on tape. Cache misses result in older data being retrieved from tape and stored again in the DASD cache.
To maintain a consistent data storage format in VTS, it is desirable to use one substantially common tape-like storage format for both DASD and tape media. When this tape-like storage format is applied to DASD, however, some of the normal mechanisms for locating data on tape are no longer useful. Chiefly, the data is not stored with IBGs, which are inapplicable to the direct-access storage format. Even with IBGs, however, access to DASD data would be severely retarded by requiring the DASD head to sequence record-by-record through the data, when direct access is possible. Thus, certain improvements to strict tape storage formats are needed for storing data in the VTS environment, to take advantage of the inherently rapid data access potential of DASD storage.
Broadly, the present invention concerns the use of a volume trailer to more efficiently store and access digital data on/from a DASD to emulate sequential-access media. According to one particular embodiment, data is stored in records, logically assembled into record groups. Interspersed with the records, there may be one or more marker codes, which function like tape marks among the various data records. The volume trailer contains pointers to each record group, record counts for each group, marker code counts for each group, and indicators of whether records in each record group are of equal length. The volume trailer may also include a volume trailer xe2x80x9ctailxe2x80x9d, including information such as a byte count for the entire volume trailer, and a unique sequence identifying the volume trailer.
The statistics contained in the volume trailer enable substantially more efficient access of the data by a DASD. For example, the invention includes specific techniques employing record groupings, group counts, and/or marker code counts to perform operations such as locate, forward space file, and backward space file.
As an example, the locate routine starts by receiving identification of a target data record, such as a record number. Then, group count fields of the volume trailer are referenced to identify a target record group containing the target data record. The pointer field corresponding to the target record group points to its beginning address in storage. A beginning record header is read at the first address to determine whether the first record header corresponds to the target data record. If the first record header does not correspond to the target data record, the routine repeatedly advances to a succeeding record header and reads the succeeding record header until a record header corresponding to the target data record is read.
The forward space file routine advances from an original or xe2x80x9ccurrentxe2x80x9d address to a target address containing the next marker code following the original address. First, the routine consults the volume trailer to determine the number of marker codes in the original record group. Then, if the original record group contains marker codes, the routine sequentially advances through each remaining record until a first marker code is reached. Otherwise, if the original record group does not contain any marker codes, or none was found after the starting point, the volume trailer is consulted to determine whether any record groups subsequent to the original record group contain any marker codes. If no record groups subsequent to the original record group contain any marker codes, an error message is issued.
Otherwise, if one or more record groups subsequent to the original record group contains any marker codes, the routine consults the volume trailer to identify a beginning address for a first one of said record groups subsequent to the original record group containing any marker codes, and sequentially reads each record header starting at the beginning address until reaching the first marker code in the first record group.
The backward space file routine of the invention proceeds in reverse from an original address to a target address containing the marker code previous to the original address. The routine first consults the volume trailer to determine the number of marker codes in the original record group. If the original record group contains marker codes, the routine consults the volume trailer to determine the beginning address of the original record group, and starting at the beginning address, sequentially advances through each remaining record until reaching a last marker code prior to the original address.
If the original record group does not contain marker codes before the starting point, the routine consults the volume trailer to determine whether any record groups previous to the original record group contain marker codes. If no record groups prior to the original record group contain any marker codes, an error message is issued. Otherwise, if one or more record groups prior to the original record group contains any marker codes, the routine consults the volume trailer to identify a beginning address for a last one of said record groups prior to the original record group containing any marker codes, and sequentially reading each record header starting at the beginning address until reaching the last marker code in the last record group.
In one embodiment, the invention may be implemented to provide a method to store and/or access store digital data having a volume trailer of constructed according to the invention. In another embodiment, the invention may be implemented to provide an apparatus to store and/or access digital data stored with a volume trailer constructed according to the invention. In still another embodiment, the invention may be implemented to provide a programmed product comprising signal-bearing media tangibly embodying a program of machine-readable instructions executable by a digital data processing apparatus to perform method steps for storing and/or accessing digital data stored with a volume trailer constructed according to the invention.
The invention affords its users with a number of distinct advantages. For example, the invention provides an especially efficient means for rapidly locating particular stored digital data records. This is because the volume trailer contains information including various specialized pointing, counting, and marking information. One particularly advantageous application of the invention is in VTS systems, where digital data is stored on DASD, which emulates tape storage. The volume trailer of the invention aids in locating DASD-stored data, which lacks certain location information normally available in tape-stored data.
The forward and backward space file operations using the invention""s volume trailer are especially efficient in comparison to implementation of these operations without the volume trailer, using a combination of rewind and read operations. In particular, lacking the volume trailer, the backward space file operation would require scanning of the volume up to a current position, noting where the last marker code was found, then rewinding and scanning back to the marker code position. Thus, the availability of the pointers and counters provided by the volume trailer of the invention significantly boosts the speed of accessing data.
The invention also provides a number of other advantages and benefits, which will be apparent from the following description of the invention.